package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.ComponentGrantsMapper;
import com.ruoyi.business.domain.ComponentGrants;
import com.ruoyi.business.service.IComponentGrantsService;

/**
 * 统一的组件权限表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-18
 */
@Service
public class ComponentGrantsServiceImpl implements IComponentGrantsService 
{
    @Autowired
    private ComponentGrantsMapper componentGrantsMapper;

    /**
     * 查询统一的组件权限表
     * 
     * @param id 统一的组件权限表主键
     * @return 统一的组件权限表
     */
    @Override
    public ComponentGrants selectComponentGrantsById(Long id)
    {
        return componentGrantsMapper.selectComponentGrantsById(id);
    }

    /**
     * 查询统一的组件权限表列表
     * 
     * @param componentGrants 统一的组件权限表
     * @return 统一的组件权限表
     */
    @Override
    public List<ComponentGrants> selectComponentGrantsList(ComponentGrants componentGrants)
    {
        return componentGrantsMapper.selectComponentGrantsList(componentGrants);
    }

    /**
     * 新增统一的组件权限表
     * 
     * @param componentGrants 统一的组件权限表
     * @return 结果
     */
    @Override
    public int insertComponentGrants(ComponentGrants componentGrants)
    {
        componentGrants.setCreateTime(DateUtils.getNowDate());
        return componentGrantsMapper.insertComponentGrants(componentGrants);
    }

    /**
     * 修改统一的组件权限表
     * 
     * @param componentGrants 统一的组件权限表
     * @return 结果
     */
    @Override
    public int updateComponentGrants(ComponentGrants componentGrants)
    {
        componentGrants.setUpdateTime(DateUtils.getNowDate());
        return componentGrantsMapper.updateComponentGrants(componentGrants);
    }

    /**
     * 批量删除统一的组件权限表
     * 
     * @param ids 需要删除的统一的组件权限表主键
     * @return 结果
     */
    @Override
    public int deleteComponentGrantsByIds(Long[] ids)
    {
        return componentGrantsMapper.deleteComponentGrantsByIds(ids);
    }

    /**
     * 删除统一的组件权限表信息
     * 
     * @param id 统一的组件权限表主键
     * @return 结果
     */
    @Override
    public int deleteComponentGrantsById(Long id)
    {
        return componentGrantsMapper.deleteComponentGrantsById(id);
    }
}
